module.exports = {
  pages: {
    arduino1: {
      entry: "src/main.js",
      template: "public/zh-cn.html",
      filename: "zh-cn.html"
    },
    arduino2: {
      entry: "src/main.js",
      template: "public/en.html",
      filename: "en.html"
    },
    index: {
      entry: "src/index/main.js",
      template: "public/index.html",
      filename: "index.html"
    }
  },
  configureWebpack: {
    externals: {
      goog: "goog",
      Blockly: "Blockly",
    },
    module: {
      rules: [
        {
          test: /\.xml$/,
          use: [
            {
              loader: "xml-loader"
            }
          ]
        }
      ]
    }
  },
  pluginOptions: {
    electronBuilder: {
      externals: [
        "baidu-aip-sdk",
        "core-js",
        "electron-log",
        "electron-updater",
        "element-ui",
        "fast-xml-parser",
        "he",
        "yauzl",
        "serialport",
        "underscore",
        "axios",
        "js-audio-recorder",
        "vue"
      ],
      builderOptions: {
        appId: "com.hterobot.dblock.bate",
        productName: "DouBao编程软件",
        copyright: "Copyright © 2019 北京哈工科教机器人科技有限公司",
        asar: false,
        publish: {
          provider: "generic",
          url: "https://doubaobit.oss-cn-beijing.aliyuncs.com/scratch/"
        },
        win: {
          target: "nsis"
        },
        nsis: {
          oneClick: false,
          perMachine: true,
          allowToChangeInstallationDirectory: true,
          allowElevation: false
        },
        mac: {
          target: "dmg",
          category: "public.app-category.tools"
        }
      }
    }
  }
};
